      FUNCTION TSOIL(ix,iy,timeho)

      use ALLOC, only : &
      & tsmed, pi
  
      implicit none

      integer(4), intent(in) :: ix, iy
      real(8), intent(in) :: timeho

      real(8) :: TSOIL

      real(8) :: pi180, A

      pi180=4.*datan(1.d0)/180.

!      tsoil=462.86962-62.3327*timeho+8.04565*(timeho**2)- &
!      & 0.4015*(timeho**3)+0.00678*(timeho**4)

      A = 10.
      tsoil = tsmed(ix,iy) + A*sin(2*pi*timeho/24.-pi/2.)
     
      return
      END FUNCTION TSOIL
